home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1997 July / Freeware CD.iso / FREEWARE / !utils / sfs / SFS117!.EXE / SFS7.DOC < prev    next >
Encoding:
Text File  |  1995-03-20  |  76.0 KB  |  1,395 lines

  1. Design Details
  2. --------------
  3.  
  4. This section goes into a few of the more obscure details not covered in the
  5. section on security analysis, such as the encryption algorithm used by SFS, the
  6. generation of random numbers, the handling of initialization vectors (IV's),
  7. and a brief overview on the deletion of sensitive information retained in
  8. memory after a program has terminated (this is covered in more detail in the
  9. section "Security Analysis" above).
  10.  
  11.  
  12. The Encryption Algorithm used in SFS
  13.  
  14. Great care must be taken when choosing an encryption algorithm for use in
  15. security software.  For example, the standard Unix crypt(1) command is based on
  16. a software implementation of a rotor machine encryption device of the kind
  17. which was broken by mathematicians using pencil and paper (and, later on, some
  18. of the first electronic computers) in the late 1930's[1].  Indeed, there exists
  19. a program called `crypt breaker's workbench' which allows the automated
  20. breaking of data encrypted using the crypt(1) command[2].  The insecurity of
  21. various other programs has been mentioned elsewhere.  It is therefore
  22. imperative that a reliable encryption system, based on world-wide security
  23. standards, and easily verifiable by consulting these standards, be used.
  24.  
  25. When a block cipher is used as a stream cipher by running it in CFB (cipher
  26. feedback) mode, there is no need for the cipher's block transformation to be a
  27. reversible one as it is only ever run in one direction (generally
  28. encrypt-only).  Therefore the use of a reversible cipher such as DES or IDEA is
  29. unnecessary, and any secure one-way block transformation can be substituted.
  30. This fact allows the use of one-way hash functions, which have much larger
  31. block sizes (128 or more bits) and key spaces (512 or more bits) than most
  32. reversible block ciphers in use today.
  33.  
  34. The transformation involved in a one-way hash function takes an initial hash
  35. value H and a data block D, and hashes it to create a new hash value H':
  36.  
  37.     hash( H, D ) -> H'
  38.  
  39. or, more specifically, in the function used in SFS:
  40.  
  41.     H + hash( D ) -> H'
  42.  
  43. This operation is explained in more detail in FIPS Publication 180 and ANSI
  44. X9.30 part 2, which define the Secure Hash Standard.  By using H as the data
  45. block to be encrypted and D as the key, we can make the output value H'
  46. dependant on a user-supplied key. That is, when H is the plaintext, D is the
  47. encryption key, and H' is the ciphertext:
  48.  
  49.      plaintext H
  50.          |
  51.          v
  52.     +---------+
  53.     |   SHS   |<- key D
  54.     +---------+
  55.          |
  56.          v
  57.     ciphertext H'
  58.  
  59. If we regard it as a block cipher, the above becomes:
  60.  
  61.     H' = SHS( H )
  62.  
  63. which is actually:
  64.  
  65.     C  =   e( P )
  66.  
  67. Since we can only ever "encrypt" using a one-way hash function, we need to run
  68. the "cipher" in cipher feedback mode, which doesn't require a reversible
  69. encryption algorithm.
  70.  
  71. By the properties of the hash function, it is computationally infeasible to
  72. either recover the key D or to control the transformation H -> H' (in other
  73. words given a value for H' we cannot predict the H which generated it, and
  74. given control over the value H we cannot generate an arbitrary H' from it).
  75.  
  76. The MDC encryption algorithm is a general encryption system which will take any
  77. one-way hash function and turn it into a stream cipher running in CFB mode. The
  78. recommended one-way hash function for MDC is the Secure Hash Standard as
  79. specified in Federal Information Processing Standards (FIPS) Publication 180
  80. and ANSI X9.30 part 2.  SHS is used as the block transformation in a block
  81. cipher run in CFB mode as detailed in AS 2805.5.2 section 8 and ISO 10116:1991
  82. section 6, with the two parameters (the size of the feedback and plaintext
  83. variables) j and k both being set to the SHS block size of 160 bits.  The
  84. properties of this mode of operation are given in Appendix A3 of AS 2805.5.2
  85. and Annex A.3 of ISO 10116:1991.  The CFB mode of operation is also detailed in
  86. a number of other standards such as FIPS Publication 81 and USSR Government
  87. Standard GOST 28147-89, Section 4.  The use of an initialization vector (IV) is
  88. as given in ISO 10126-2:1991 section 4.2, except that the size of the IV is
  89. increased to 160 bits from the 48 or 64 bits value given in the standard. This
  90. is again detailed in a number of other standards such as GOST 28147-89 Section
  91. 3.1.2. The derivation of the IV is given in the section "Encryption
  92. Considerations" below.
  93.  
  94. The key setup for the MDC encryption algorithm is performed by running the
  95. cipher over the encryption key (in effect encrypting the key with MDC using
  96. itself as the key) and using the encrypted value as the new encryption key.
  97. This procedure is then repeated a number of times to make a "brute-force"
  98. decryption attack more difficult, as per the recommendation in the Public-Key
  99. Cryptography Standard (PKCS), part 1.  This reduces any input key, even one
  100. which contains regular data patterns, to a block of white noise equal in size
  101. to the MDC key data.
  102.  
  103. The exact key scheduling process for MDC is as follows:
  104.  
  105.  Initialization:
  106.  
  107.  - The SHS hash value H is set to the key IV[3].
  108.  - The SHS data block D is set to all zeroes.
  109.  - The key data of length 2048 bits is set to a 16-bit big-endian value
  110.    containing the length of the user key in bytes, followed by up to 2032 bits
  111.    of user key.
  112.  
  113.    SHS hash value H = key IV;
  114.    SHS data block D = zeroes;
  115.    key_data [0:15] = length of user key in bytes;
  116.    key_data [16:2047] = user key, zero-padded;
  117.  
  118.  Key schedule:
  119.  
  120.  - The following process is iterated a number of times:
  121.  
  122.    - The 2048-bit key data block is encrypted using MDC.
  123.    - Enough of the encrypted key data is copied from the start of the key data
  124.      block into the SHS data block D to fill it.
  125.  
  126.    for i = 1 to 200 do
  127.        encrypted_key = encrypt( key_data );
  128.        D = encrypted_key;
  129.  
  130. During the repeated encryptions, the IV is never reset.  This means that the IV
  131. from the end of the n-1 th data block is re-injected into the start of the n th
  132. data block.  After 200 iterations, the "randomness" present in the key has been
  133. diffused throughout the entire key data block.
  134.  
  135. Although the full length of the key data block is 2048 bits, the SHS algorithm
  136. only uses 512 bits of this (corresponding to the SHS data block D) per
  137. iteration.  The remaining 1536 bits take part in the computation (by being
  138. carried along via the IV) but are not used directly.  By current estimates
  139. there are around 2^256 atoms in the universe.  Compiling a table of all 2^512
  140. possible keys which would be necessary for a brute-force attack on MDC would
  141. therefore be a considerable challenge to an attacker, requiring, at least, the
  142. creation of another 512 * 2^256 universes to hold all the keys.  Even allowing
  143. for the current best-case estimate of a creation time of 7 days per universe,
  144. the mere creation of storage space for all the keys would take an unimaginably
  145. large amount of time.
  146.  
  147. The SFS key schedule operation has been deliberately designed to slow down
  148. special hardware implementations, since the encryption algorithm is rekeyed
  149. after each iteration.  Normal high-speed password-cracking hardware would (for
  150. example, with DES) have 16 separate key schedules in a circular buffer, each
  151. being applied to a different stage of a 16-stage pipeline (one stage per DES
  152. round) allowing a new result to be obtained in every clock cycle once the
  153. pipeline is filled.  In MDC the key data is reused multiple times during the 80
  154. rounds of SHS, requiring 80 separate key schedules for the same performance as
  155. the 16 DES ones.  However since the algorithm is rekeyed after every iteration
  156. for a total of 200 iterations, this process must either be repeated 200 times
  157. (for a corresponding slowdown factor of 200), or the full pipeline must be
  158. extended to 16,000 stages to allow the one-result-per-cycle performance which
  159. the 16-stage DES pipeline can deliver (assuming the rekeying operation can be
  160. performed in a single cycle - in fact the 1024-bit keys used by MDC/SHS need to
  161. be processed in 7 sequential 160-bit blocks due to SHS's block size, stretching
  162. the pipeline to 112,000 stages).  Changing the iteration count to a higher
  163. value will further slow down this process.
  164.  
  165. The number of iterations of key encryption is controlled by the user, and is
  166. generally done some hundreds of times.  The setup process in SFS has been tuned
  167. to take approximately half a second on a workstation rated at around 15 MIPS
  168. (corresponding to 200 iterations of the encryption process), making a
  169. brute-force password attack very time-consuming.  Note that the key IV is
  170. injected at the earliest possible moment in the key schedule rather than at the
  171. very end, making the use of a precomputed data attack impossible.  The standard
  172. method of injecting the encryption IV at the end of the key schedule process
  173. offers very little protection against an attack using precomputed data, as it
  174. is still possible to precompute the key schedules and simply drop in the
  175. encryption IV at the last possible moment.
  176.  
  177. Footnote [1]: This is covered in a number of books, for example Welchman's "The
  178.               Hut Six Story: Breaking the Enigma Codes", New York, McGraw-Hill
  179.               1982, and Kahns "Seizing the Enigma", Boston, Houghton-Mifflin
  180.               1991.
  181.  
  182. Footnote [2]: Available from ftp.ox.ac.uk in the directory /src/security as
  183.               cbw.tar.Z.
  184.  
  185. Footnote [3]: Some sources would refer to this value as a `salt'.  The term
  186.               `key IV' is used here as this is probably a more accurate
  187.               description of its function.
  188.  
  189.  
  190. Generating Random Numbers
  191.  
  192. One thing which cryptosystems consume in large quantities are random numbers.
  193. Not just any old random value, but cryptographically strong random numbers.  A
  194. cryptographically strong random value is one which cannot be predicted by an
  195. attacker (if the attacker can predict the values which are used to set up
  196. encryption keys, then they can make a guess at the encryption key itself).
  197. This automatically rules out all software means of generating random values,
  198. and means specialised hardware must be used.
  199.  
  200. Very few PC's are currently equipped with this type of hardware.  However SFS
  201. requires 1024 random bits for each encrypted disk, in the form of the disk key
  202. (see the section "Password Lifetimes and Scope" above).  SFS therefore uses a
  203. number of sources of random numbers, both ones present in the hardware of the
  204. PC and one external source:
  205.  
  206.   - Various hardware timers which are read occasionally when the program is
  207.     running (generally after operations which are long and complex and will be
  208.     heavily affected by external influences such as interrupts, video, screen,
  209.     and disk I/O, and other factors.
  210.  
  211.   - The contents and status information of the keyboard buffer
  212.  
  213.   - Disk driver controller and status information
  214.  
  215.   - Mouse data and information
  216.  
  217.   - Video controller registers and status information
  218.  
  219. [ - The clock skew between two hardware clocks available on the PC.  Due to
  220.     background system activity such as interrupt servicing, disk activity, and
  221.     variable-length instruction execution times, these clocks run out-of-phase.
  222.     SFS uses this phase difference as a source of random numbers.  NB: Not
  223.     implemented yet].
  224.  
  225.   - The timing of keystrokes when the password is entered.  SFS reads the
  226.     high-speed 1.19 MHz hardware timer after each keystroke and uses the timer
  227.     values as a source of random numbers.  This timer is used both to measure
  228.     keystroke latency when the password is entered and read at random times
  229.     during program execution.  Trials have shown that this 16-bit counter
  230.     yields around 8 bits of random information (the exact information content
  231.     is difficult to gauge as background interrupts, video updates, disk
  232.     operations, protected-mode supervisor software, and other factors greatly
  233.     affect any accesses to this counter, but an estimate of 8 bits is probably
  234.     close enough[1]).
  235.  
  236.   - The timing of disk access latency for random disk reads.  The exact
  237.     operation is as follows:
  238.  
  239.         Read a timer-based random disk sector
  240.         Add its contents (8 bits)
  241.         Read the high-speed 1.19 MHz hardware timer (13 bits)
  242.         Use the two values for the next random sector
  243.  
  244.     This is repeated as often as required (in the case of SFS this is 10
  245.     times).  Assuming a (currently rather optimistic) maximum of 5ms to acquire
  246.     a sector this provides about 13 bits of randomness per disk operation.  The
  247.     number of factors which influence this value is rather high, and includes
  248.     among other things the time it takes the BIOS to process the request, the
  249.     time it takes the controller to process the request, time to seek to the
  250.     track on the disk, time to read the data (or, if disk cacheing is used,
  251.     time for the occasional cache hit), time to send it to the PC, time to
  252.     switch in and out of protected mode when putting it in the cache, and of
  253.     course the constant 3-degree background radiation of other interrupts and
  254.     system activity happening at the same time.  If a solid-state disk were
  255.     being used, the hardware latency would be significantly reduced, but
  256.     currently virtually no 386-class PC's have solid-state disks (they're
  257.     reserved for palmtops and the like), so this isn't a major concern.
  258.  
  259. An estimate of the number of random bits available from each source is as
  260. follows:
  261.  
  262.     Keystroke latency, 8 bits per key      80 bits for minimum 10-char key
  263.     Second password entry for encryption   80 bits for minimum 10-char key
  264.     Disk access latency, 13 bits per read 130 bits for 10 reads
  265.     Disk sector data, 8 bits               80 bits for 10 reads
  266.     System clocks and timers                3 bits
  267.     Video controller information            4 bits
  268.     Keyboard buffer information             4 bits
  269.     Disk status information                 4 bits
  270.     General system status                   4 bits
  271.     Random high-speed timer reads         120 bits for 15 reads
  272.                                           --------
  273.     Total                                 509 bits
  274.  
  275. These figures are very conservative estimates only, and are based on timing
  276. experiments with typed-in passwords and a careful scrutiny of the PC's hardware
  277. and system status data.  For example, although the time to access a disk sector
  278. for a particular drive may be 10ms or more, the actual variation on that 10ms
  279. may only be +/- 2ms.  The figures given above were taken by averaging the
  280. variation in times for large numbers of tests.  In practice (especially with
  281. longer passwords) the number of random bits is increased somewhat (for example
  282. with a 30-character password the total may be as high as 829 bits of random
  283. information).  However even the minimal estimate of 509 bits is adequate for
  284. the 512-bit key required by MDC.
  285.  
  286. Each quantum of semi-random information is exclusive-ored into a 1024-bit
  287. buffer which is initially set to all zeroes.  Once 1024 bits of buffer have
  288. been filled, the data is encrypted with MDC to distribute the information, and
  289. the first 512 bits of the 1024-bit buffer is used as the key for the next MDC
  290. encyrption pass.  Then more data is added until, again, 1024 bits of buffer
  291. have been filled, whereupon the data is again mixed by encrypting it with MDC.
  292. This process is repeated several times, with the amount of "randomness" in the
  293. buffer increasing with each iteration.
  294.  
  295. Before being used, this data is encrypted 10 times over with MDC to ensure a
  296. complete diffusion of randomness.  Since the IV for the encryption is reused
  297. for the next pass through the buffer, any information from the end of the
  298. buffer is thus reinjected at the start of the buffer on the next encryption
  299. pass.
  300.  
  301. Although this method of generating random numbers is not perfect, it seems to
  302. be the best available using the existing hardware.  General estimates of the
  303. exact amount of truly random information which can be acquired in this manner
  304. are in the vicinity of several hundred bits.  Proposed attacks all make the
  305. assumption that an attacker is in possession of what amounts to a complete
  306. hardware trace of events on the machine in question.  Allowing for a reasonable
  307. amount of physical system security, it can be assumed that the random data used
  308. in SFS is unpredictable enough to provide an adequate amount of security
  309. against all but the most determined attacker.
  310.  
  311. Footnote [1]: If an opponent can obtain several hours of keystroke timings and
  312.               can come up with a good model including serial correlations, they
  313.               may be able to reduce the likely inputs to the random number
  314.               accumulator to a somewhat smaller value, or at least bias their
  315.               guesses to fall within the range of likely values.
  316.  
  317.  
  318. Encryption Considerations
  319.  
  320. When a block cipher is converted to handle units of data larger than its
  321. intrinsic block size, a number of weaknesses can be introduced, depending on
  322. the mode of operation which is chosen for the block cipher.  For example, if
  323. two identical ciphertext blocks are present in different locations in a file,
  324. this may be used to determine the plaintext.  If we can find two identical
  325. blocks of ciphertext when cipher block chaining (CBC) is used, then we know
  326. that:
  327.  
  328.     P[ i ] = d( C[ i ] ) ^ C[ i-1 ]
  329.     P[ j ] = d( C[ j ] ) ^ C[ j-1 ]
  330.  
  331. where C is the ciphertext, P is the plaintext, and e() and d() are encryption
  332. and decryption respectively.  Now if C[ i ] = C[ j ], then d( C[ i ] ) =
  333. d( C[ j ] ), which cancel out when xor'd so that:
  334.  
  335.     P[ i ] ^ C[ i-1 ] = P[ j ] ^ C[ j-1 ]
  336.  
  337. or:
  338.  
  339.      P[ j ] = P[ i ] ^ C[ i-1 ] ^ C[ j-1 ]
  340.  
  341. Knowing C[ i ] and C[ j ] we can determine P[ i ] and P[ j ], and knowing
  342. either P[ i ] or P[ j ] we can determine the other.
  343.  
  344. Something similar holds when cipher feedback (CFB) mode is used, except that
  345. now the decryption operation is:
  346.  
  347.     P[ i ] = e( C[ i-1 ] ) ^ C[ i ]
  348.     P[ j ] = e( C[ j-1 ] ) ^ C[ j ]
  349.  
  350. Now if C[ i ] = C[ j ] then e( C[ i ] ) = e( C[ j ] ) (recall that in CFB mode
  351. the block cipher is only ever used for encryption), so that they again cancel
  352. out, so:
  353.  
  354.     P[ i ] ^ e( C[ i-1 ] ) = P[ j ] ^ e( C[ j-1 ] )
  355.  
  356. or:
  357.  
  358.     P[ i ] = P[ j ] ^ e( C[ i-1 ] ) ^ e( C[ j-1 ] )
  359.  
  360. In general this problem is of little consequence since the probability of
  361. finding two equal blocks of ciphertext when using a 160-bit block cipher on a
  362. dataset of any practical size is negligible.  More esoteric modes of operation
  363. such as plaintext feedback (PFB) and ones whose acronyms have more letters than
  364. Welsh place names tend to have their own special problems and aren't considered
  365. here.
  366.  
  367. The problem does become serious, however, in the case of sector-level
  368. encryption, where the initialization vector cannot be varied.  Although the IV
  369. may be unique for each sector, it remains constant unless special measures such
  370. as reserving extra storage for sector IV's which are updated with each sector
  371. write are taken.  If a sector is read from disk, a small change made to part of
  372. it (for example changing a word in a text file), and the sector written out to
  373. disk again, several unchanged ciphertext/plaintext pairs will be present,
  374. allowing the above attack to be applied.  However, there are cases in which
  375. this can be a problem.  For example, running a program such as a disk
  376. defragmenter will rewrite a large number of sectors while leaving the IV
  377. unchanged, allowing an opponent access to large quantities of XOR'd plaintext
  378. blocks simply by recording the disk contents before and after the
  379. defragmentation process.  Normally this problem would be avoided by using a
  380. different IV for each encrypted message, but most disk systems don't have the
  381. room to store an entire sectors worth of data as well as the IV needed to
  382. en/decrypt it.
  383.  
  384. An additional disadvantage of the CFB encryption mode is that the data in the
  385. last block of a dataset may be altered by an attacker to give different
  386. plaintext without it affecting the rest of the block, since the altered
  387. ciphertext in the last block never enters the feedback loop.  This type of
  388. attack requires that an opponent possess at least two copies of the ciphertext,
  389. and that they differ only in the contents of the last block.  In this case the
  390. last ciphertext block from one copy can be subsituted for the last ciphertext
  391. block in the other copy, allowing a subtle form of message modification attack.
  392. In fact in combination with the previously mentioned weakness of CFB, an
  393. attacker can determine the XOR of the plaintexts in the last block and
  394. substitute an arbitrary piece of "encrypted" plaintext to replace the existing
  395. data.
  396.  
  397. There are several approaches to tackling this problem.  The most simplistic one
  398. is to permute the plaintext in a key-dependant manner before encryption and
  399. after decryption.  This solution is unsatisfactory as it simply shuffles the
  400. data around without necessarily affecting any particular plaintext or
  401. ciphertext block.  The desired goal of a change in any part of the plaintext
  402. affecting the entire dataset is not achieved.
  403.  
  404. A better solution is to encrypt data twice, once from front to back and then
  405. from back to front[1].  The front-to-back pass propagates any dependencies to
  406. the back of the dataset, and the back-to-front pass propagates dependencies
  407. back to the front again.  In this way a single change in any part of the
  408. plaintext affects the entire dataset.  The disadvantage of this approach is
  409. that it at least halves the speed of the encryption, as all data must be
  410. encrypted twice. If the encryption is done in software, this may create an
  411. unacceptable loss of throughput.  Even with hardware assistance there is a
  412. noticeable slowdown, as no hardware implementations easily support backwards
  413. encryption, requiring the data to be reversed in software before the second
  414. pass is possible.
  415.  
  416. The best solution is probably to use a word-wise scrambler polynomial like the
  417. one used in SHA.  With a block of plaintext P this is:
  418.  
  419.     P[ i ] ^= P[ i-K1 ] ^ P[ i-K2 ]
  420.  
  421. with suitable values for the constants K1 and K2.  If K2 is chosen to be 5 (the
  422. SHA block size in words) then the initial values of the 5 words (which can be
  423. thought of as as P[ -5 ]...P[ -1 ]) are simply the sectorIV.  The value of K1
  424. is arbitrary, SFS uses a value of 4.
  425.  
  426. This technique is used by first setting the initial values of the 5 words to
  427. the sectorIV.  The scrambler function is then run over the entire data block,
  428. propagating all dependencies to the last 5 words in the block.  These last 5
  429. words are then used as the IV for the CFB encryption of the entire block.  In
  430. this way the encryption IV depends on all the bits in the block, and the
  431. scrambling does a moderately good job of breaking up statistical patterns in
  432. the plaintext.  No information is lost, so no randomness in the sectorIV is
  433. misplaced.
  434.  
  435. This also provides resistance to the selective-modification attack which allows
  436. an attacker to change selected bits in the last block of a CFB-encrypted
  437. dataset without damage.  By destroying the IV used in the CFB encryption, the
  438. first block is completely corrupted, which is unlikely to go unnoticed.
  439.  
  440. To decrypt a dataset encrypted in this manner, the first 5 words of ciphertext
  441. are shifted into the feedback path, and the remainder of the dataset is
  442. decrypted in the standard manner.  The last 5 decrypted words are then used as
  443. the IV to decrypt the first encrypted block.  Finally, the scrambler is run
  444. over the recovered plaintext to undo the changes made during the encryption
  445. scrambling.
  446.  
  447. The overall en/decryption process used by SFS, in the case of 512-byte sectors
  448. and 32-bit words (so that each sector contains 128 words), is:
  449.  
  450.     Encryption:
  451.  
  452.         using sectorIV[ 0 ]...sectorIV[ 4 ] as the scrambler IV
  453.             scramble data[ 0 ]...data[ 127 ]
  454.         using data[ 127-5 ]...data[ 127-1 ] as the encryption IV
  455.             encrypt data[ 0 ]...data[ 127 ]
  456.  
  457.     Decryption:
  458.  
  459.         using data[ 0 ]...data[ 4 ] as the encryption IV
  460.             decrypt data[ 5 ]...data[ 127 ]
  461.         using data[ 127-5 ]...data[ 127-1 ] as the encryption IV
  462.             decrypt data[ 0 ]...data[ 4 ]
  463.         using sectorIV[ 0 ]...sectorIV[ 4 ] as the scrambler IV
  464.             scramble data[ 0 ]...data[ 127 ]
  465.  
  466. where the scrambling operation is:
  467.  
  468.         data[ i ] ^= data[ i-4 ] ^ data[ i-5 ]
  469.  
  470. as outlined above.  Note that the i-4 and i-5 th values referred to here are
  471. the original, scrambled values, not the descrambled values.  The easiest way to
  472. implement this is to cache the last 5 scrambled values and cyclically overwrite
  473. them as each word in the data buffer is processed.
  474.  
  475. Footnote [1]:  To be precise, you need some sort of feedback from the end of
  476.                a block on the first encryption pass to the start of the block
  477.                on the next encryption pass.  A block can be encrypted forwards
  478.                twice as long as the IV is wrapped back to the start of the
  479.                block for the second encryption pass.
  480.  
  481.  
  482. A Discussion of the MDC Encryption Algorithm[1]
  483.  
  484. (A word on notation:  The notation {0,1}^k is used to mean the set of all bit
  485. strings of length k, and {0,1}* means the set of all bit strings, including the
  486. empty string.  Any message can be viewed as a bit string by means of a suitable
  487. encoding).
  488.  
  489. The encryption method used by SFS is somewhat unusual, and in some respects is
  490. similar to Merkle's "Meta Method" for obtaining cryptosystems[2].  The method
  491. relies on the existence of secure one-way hash functions.  A hash function is a
  492. function that takes as input an arbitrary number of bits and produces a
  493. fixed-sized output called the "message digest".  In other words, hash functions
  494. have the form
  495.  
  496.     h : {0,1}* --> {0,1}^k              for some fixed k,
  497.  
  498. and the hash of a message M is defined to be h( M ).  A secure one-way hash
  499. function is a hash function with the following properties:
  500.  
  501.     1. For each message M, it is easy to compute h( M ).
  502.  
  503.     2. Given M, it is computationally infeasible to compute M' with
  504.        h( M ) = h( M' ) (secure against forgery).
  505.  
  506.     3. It is computationally infeasible to compute M and M' with
  507.        h( M ) = h( M' ) (secure against collisions).
  508.  
  509. For a good, but rather technical, discussion of hash functions, see
  510. "Contemporary Cryptology. The Science of Information Integrity" edited by
  511. Gustavus Simmons, IEEE Press, 1992 (ISBN 0-87942-277-7).
  512.  
  513. The terms "easy to compute" and "infeasible to compute" can be given more
  514. precise definitions, but we'll settle for this informal terminology for now.
  515. Roughly speaking, "easy to compute" means that it will take a tolerable amount
  516. of time to compute the answer, even on a rather small machine; "infeasible to
  517. compute" means that it should take eons to find out a particular result, even
  518. when using millions of computers of the fastest conceivable technology in
  519. parallel.
  520.  
  521. Examples of hash functions include the MD2, MD4, and MD5 hash functions,
  522. developed by Ron Rivest of RSA Data Security, Inc., which have been (at least
  523. in the case of MD4 and MD5) placed in the public domain, and the Secure Hash
  524. Standard SHS, developed by NIST (with significant input from the NSA).  The
  525. existence of secure one-way hash functions has not been proven, although there
  526. exist some strong candidates, including MD5 and SHS.
  527.  
  528. The reference implementations of the above hashing functions include one
  529. interesting aspect which makes it possible to use them as encryption functions.
  530. Since the hashing of a very large amount of data in one sweep is not desirable
  531. (because all the data would have to be in memory at the time of hashing), most
  532. hashing algorithms allow data to be hashed incrementally.  This is made
  533. possible by augmenting the definition of a hash function to include the state
  534. of the last hashing operation.  In other words, a hash function now has the
  535. form
  536.  
  537.     h : {0,1}^k x {0,1}* --> {0,1}^k,
  538.  
  539. where the first argument is the previous hash value, and the hash of a message
  540. M = ( M1, M2, ..., Mn ) is defined to be
  541.  
  542.     h( h( ...( h( h0, M1 ), M2 ), ... ), Mn ).
  543.  
  544. (The value of all the h evaluations must not change if the message is broken up
  545. into blocks of different lengths, but all of the previously mentioned hash
  546. functions have that property).  Here, h0 is a fixed, known initial value that
  547. is used in all hashing calculations.
  548.  
  549. This is not the way "real" hash functions behave, but it is close enough.  For
  550. example, the MD5 hashing function has "initialization", "updating", and
  551. "finalization" parts, where the finalization part appends the number of hashed
  552. bytes to the message, hashes one final time, and returns the final hash value.
  553. This means that the hashing "context" must include the number of bytes hashed
  554. so far, without it being a part of the hash value.  The hash function can be
  555. said to have "memory".
  556.  
  557. If we assume that h is a secure one-way hashing function, we can now use such
  558. an h as a scrambling device.  For example, if we set E( M ) = h( h0, M ) for
  559. every message M, M will not be recoverable from E( M ), because h is secure by
  560. definition.  Another method would be to supply M to any standard MSDOS or UNIX
  561. utility and use the resulting error message as the ciphertext (remembering that
  562. a computer is a device for turning input into error messages).  However, there
  563. are still two problems to be solved before we can use hash functions as
  564. encryption functions:
  565.  
  566.     1. The scrambling process is not controlled by a key.
  567.  
  568.     2. The scrambling process is not invertible, so there is no way to
  569.        decrypt the ciphertext.
  570.  
  571. Both problems can be solved by interchanging the roles of hash and data and by
  572. using CFB mode in the encryption process.  In other words, let K be an
  573. arbitrarily long key, let M = ( M1, ..., Mn ) be a message, broken up into
  574. chunks of k bits, let IV be an initialization vector, and set
  575.  
  576.     C1 = M1 xor h( IV, K )
  577.     Ci = Mi xor h( C( i-1 ), K )        for 1 < i <= n.
  578.  
  579. This is sent to the recipient, who easily recovers the plaintext by
  580.  
  581.     P1 = C1 xor h( IV, K )
  582.     Pi = Ci xor h( C( i-1 ), K )                for 1 < i <= n,
  583.  
  584. since we have
  585.  
  586.     P1 = ( M1 xor h( IV, K ) ) xor h( IV, K )
  587.        = M1 xor ( h( IV, K ) xor h( IV,K ) )    because xor is associative,
  588.        = M1 xor 0,                              because x xor x = 0,
  589.        = M1,                                    because x xor 0 = x,
  590.  
  591. and similarly for the Pi's.  This method of encryption also offers more
  592. security than using ECB mode, assuming that this were possible with hash
  593. functions, since the plaintext is diffused over the entire ciphertext,
  594. destroying plaintext statistics, and thus foiling straightforward ciphertext
  595. correlation attacks.
  596.  
  597. This method can clearly be used for any hash function which can hash
  598. incrementally.  Thus, it is a "Meta Method" for turning hash functions into
  599. encryption functions.  This is called the Message Digest Cipher (MDC) method of
  600. encryption.  Specific instances of the method have the name of the hash
  601. function added as a suffix.  For example, the MDC method applied to the MD5
  602. hash function would be referred to as MDC/MD5.  SFS uses MDC/SHS.
  603.  
  604. Having analysed the inner workings of MDC, at least one theoretical attack on
  605. the algorithm should be mentioned.  There are certain properties of hash
  606. functions which may make them unsuitable for use as encryption algorithms.  For
  607. example suppose knowledge of a 160-bit input/output pair to SHS leaks a
  608. fraction of a bit of information about the data being hashed, maybe a quarter
  609. of a bit.  This allows a search of 2^159.75 data blocks to find another data
  610. block that causes the given input-output transformation, and thus finds a
  611. second message which produces the same hash value.  This problem is not
  612. significant when SHS is used as a cryptographic hash function, since it only
  613. reduces the search space by 16% from the full 2^160 possibilities.  However
  614. when SHS is used for encryption, it may be possible to accumulate these quarter
  615. bits, so that after 2560 blocks (50K) of known plaintext, enough bits have been
  616. accumulated to compute the encryption key.  This is because multiple
  617. input/output pairs are available for a given data block, and each one puts more
  618. constraints on the block until eventually you have the actual value can be
  619. determined.
  620.  
  621. If a hash function is has the properties given above and no such information is
  622. leaked, it can serve to create a strong encryption algorithm, but a serious
  623. weakness in the encryption algorithm is not necessarily a serious weakness in
  624. the hash function.  To date noone has ever demonstrated such a weakness, and
  625. there are a number of similar "what if" arguments which can be used against
  626. most encryption schemes.  For example if it were possible to build a quantum
  627. computer then it could be used to break many of the most popular public-key
  628. encryption schemes in use today.  The reason that these schemes aren't being
  629. abandoned is that it is very unlikely that any computer of this form will be
  630. built, and that if someone does manage it then the implications will be far
  631. more serious than just the breaking of a number of encryption schemes.
  632.  
  633. Footnote [1]: Most of this analysis was contributed by Stephan Neuhaus,
  634.               <neuhaus@informatik.uni-kl.de>
  635.  
  636. Footnote [2]: This is discussed further in Ralph Merkle's paper "One Way Hash
  637.               Functions and DES", Crypto '89 Proceedings, Springer-Verlag,
  638.               1989 (volume 435 of the Lecture Notes in Computer Science
  639.               series).
  640.  
  641.  
  642. Smart cards and SFS
  643.  
  644. Due to their sealed, self-contained nature, smart cards provide a reasonable
  645. amount of security against many forms of attack such as the trojan horse
  646. variety with which it is so easy to compromise security on a more
  647. general-purpose computer such as a PC.  However in the last few years a large
  648. amount of expertise in attacking smart-card based systems has been gathered by
  649. people who target pay-TV systems which rely on smart-card based processors for
  650. security.  Pay-TV pirates have been very successful in picking apart supposedly
  651. secure processors in order to clone them or defeat their encryption.
  652. Typically, this might be done by heating the device to 150 C and then
  653. dissolving it in fuming nitric acid.  An alternative is to use sulphuric acid
  654. at 300 C.  By using a special fixture which produces a small jet via capillary
  655. action, the part of the package over the chip die can be removed.
  656.  
  657. Once the packaging has been removed, only the bond wires are left to hold the
  658. leads to the die so the IC will fall apart, leaving the die available for
  659. analysis.  If done correctly, this disassembly of the device will allow the
  660. part to remain functional.  One generation of the Sky TV smart cards were
  661. reverse-engineered using this technique to get to the chips and a scanning
  662. electron microscope to read out the contents of the individual ROM cells.
  663.  
  664. Another commonly-used technique is to selectively erase the security fuses used
  665. to protect some types of secure microprocessor, allowing the contents of the
  666. ROM to be read out and disassembled.  For example, the security bits in the
  667. 8751 microcontroller aren't located anywhere near the EPROM in the device, and
  668. can be selectively erased without affecting the main memory contents, which are
  669. now unprotected and can be read out.  Another way to bypass the security bits
  670. in this device is to manipulate the voltages and control signals fed to it,
  671. which causes it to become confused about whether it should be accessing the
  672. internal, protected memory, or external, unprotected memory.  By using code
  673. located in the external memory it is possible to access the contents of the
  674. internal memory.  This technique has been used to recover the memory contents
  675. of an 87C51 on a smart card with all security features enabled.
  676.  
  677. Sometimes it is possible to find an address on the card which contains an
  678. opcode corresponding to a jump to code stored in external memory, so that by
  679. changing the external program, it is possible to sieze control of the card
  680. (this method was used to hack the Futuretron video scrambling system).  It is
  681. occasionally possible to gradually erase the security fuse in one-time
  682. programmable and EPROM-programmable secure processors by slowly increasing or
  683. decreasing the supply voltage fed to the chip.  Although this generally erases
  684. or damages the data on the chip as well, it is possible to recover the contents
  685. by combining information read from several chips.
  686.  
  687. A much more sophisticated way to reverse-engineer chips uses thermal neutron
  688. imaging to perform a non-invasive analysis of the device.  Intense pulsed
  689. neutron source (IPNS) thermal neutrons can be used to image crystal structures
  690. of many angstroms, and is a non-ionizing form of radiation which can penetrate
  691. several meters of material.  By setting the pulses to pass through cold crystal
  692. structures, coherent waves of neutrons can be generated and various layers of a
  693. chip can be focused on and analyzed by moving either the chip or the detector.
  694. Although the electrical nature of the structure such as the values of any
  695. stored charges can't be seen this way, it is possible to duplicate the
  696. structure with a non-invasive method and then experiment with the voltages in
  697. the duplicate.
  698.  
  699. This method of analysis requires vast resources, but there are many countries
  700. with the necessary nuclear reactors, and creating thermal coherent neutron
  701. waves isn't excessively difficult.  The method is also very difficult to
  702. protect against.
  703.  
  704. Attacks of this sort, which involve physical analysis of the card contents and
  705. which rely for their success on the ability to read out the internal circuitry
  706. and memory contents of the card, apply only to cards using ROM or EPROM
  707. technology, in which (typically) a memory cell is implemented as a fuse which
  708. is blown when the card is programmed.  The blown and non-blown fuses can then
  709. be read out using one of the techniques described above, and the memory
  710. contents reconstructed.
  711.  
  712. In contrast, the cards used with SFS use EEPROM memory cells rather than EPROM
  713. ones.  In an EEPROM, data is stored as the presence or abscence of an
  714. electrical charge, which means that the contents of a memory cell cannot be
  715. determined by a physical examination as they can for a conventional ROM or
  716. EPROM cell.  An attack therefore requires disassembling the package and probing
  717. the contents of each memory cell electrically, which requires significantly
  718. more resources than an examination under an electron microscope.
  719.  
  720. As an additional security precaution, SFS encrypts all critical data stored on
  721. the card in the same way that it encrypts data stored in the SFS volume header.
  722.  
  723. In normal operation, each SFS disk volume is encrypted with a unique disk key
  724. which is completely unrelated to the the user passphrase, or key.  When the
  725. user key is entered, it is used to decrypt the disk key, and the disk key is
  726. then used to decrypt the encrypted volume.  There is no correlation between the
  727. user key and the disk key, so that revealing the disk key does not reveal the
  728. user key.  This access mechanism looks as follows:
  729.  
  730.  + User  - - - +            + Encrypted volume  - - - - - - - - - - - - +
  731.  
  732.  | +--------+  |  decrypt   | +--------+   decrypt    +--------------+  |
  733.    |User Key|   ----------->  |Disk Key| -----------> |Encrypted Data|
  734.  | +--------+  |            | +--------+              +--------------+  |
  735.  
  736.  + - - - - - - +            + - - - - - - - - - - - - - - - - - - - - - +
  737.  
  738. When used with a smart card, the user key is instead used to decrypt a key
  739. stored in the smart card which is in turn used to decrypt the disk key:
  740.  
  741.  + User  - - - +            + Smart card  +
  742.  
  743.  | +--------+  |  decrypt   | +--------+  |  decrypt
  744.    |User Key|   ----------->  |Card Key|   ----------+
  745.  | +--------+  |            | +--------+  |          |
  746.                                                      |
  747.  + - - - - - - +            + - - - - - - +          |
  748.                                                      |
  749.                      +-------------------------------+
  750.                      |
  751.                      |      + Encrypted volume  - - - - - - - - - - - - +
  752.                      |
  753.                      |      | +--------+   decrypt    +--------------+  |
  754.                      +----->  |Disk Key| -----------> |Encrypted Data|
  755.                             | +--------+              +--------------+  |
  756.  
  757.                             + - - - - - - - - - - - - - - - - - - - - - +
  758.  
  759. Since the password is no longer used to directly decrypt the disk key to access
  760. the encrypted volume, knowledge of the user password or key, or any attack
  761. based on the user password or key is of no use unless the attacker is also in
  762. posession of the smart card containing the card key.  Since a single card key
  763. can be used to decrypt multiple disk keys, it is possible for one card to
  764. control access to multiple encrypted volumes.  Finally, since each card key can
  765. also contain extra information such as access rights to an encrypted volume, it
  766. is possible for a central authority to issue to cards which control the type of
  767. access allowed for the volume, such as cards which only grant read access to
  768. their holders.
  769.  
  770. In order to convert a volume from direct user access to smart-card access, it
  771. is necessary to first initialise the card for use with SFS by generating a
  772. random card key and encrypting it with the user key, and then to bind the card
  773. to a disk volume by encrypting the disk key with the card key.  The first,
  774. initialization step is performed as follows:
  775.  
  776.     Generate a random card key
  777.     Encrypt the card key with the user key for the card
  778.     Write the encrypted card key to the card
  779.  
  780.                     Card key
  781.                        |
  782.                        v
  783.       User key    +---------+
  784.         for   --> | Encrypt |
  785.        card       +---------+
  786.                        |
  787.                        v
  788.                    Smart card
  789.  
  790. To recover the card key, the user key for the card is used to decrypt the key
  791. stored on the card.
  792.  
  793. The second, card binding step is performed as follows:
  794.  
  795.     Decrypt the disk key with the user key for the disk
  796.     Decrypt the card key with the user key for the card
  797.     Encrypt the disk key with the card key
  798.     Write the encrypted disk key to the disk
  799.  
  800.                    Smart card                    Disk volume
  801.                        |                             |
  802.                        v                             v
  803.       User key    +---------+       User key    +---------+
  804.         for   --> | Decrypt |         for   --> | Decrypt |
  805.        card       +---------+        disk       +---------+
  806.                        |                             |
  807.                     Card key                      Disk key
  808.                        |                             |
  809.                        |               +-------------+
  810.                        |               |
  811.                        |               v
  812.                        |          +---------+
  813.                        +--------> | Encrypt |
  814.                                   +---------+
  815.                                        |
  816.                                        v
  817.                                    Disk volume
  818.  
  819. To recover the card key, the user key for the card is used to decrypt the key
  820. stored on the card.  To recover the disk key, the decrypted card key obtained
  821. in the previous step is used to decrypt the key stored on the disk.
  822.  
  823. To access a volume using the smart card, the following process is used:
  824.  
  825.     Decrypt the card key with the user key for the card
  826.     Decrypt the disk key with the card key
  827.     Access the volume using the disk key
  828.  
  829.                    Smart card
  830.                        |
  831.                        v
  832.       User key    +---------+
  833.         for   --> | Decrypt |
  834.        card       +---------+
  835.                        |
  836.                     Card key      Disk volume
  837.                        |               |
  838.                        |               v
  839.                        |          +---------+
  840.                        +--------> | Encrypt |
  841.                                   +---------+
  842.                                        |
  843.                                        v
  844.                                    Disk key
  845.  
  846. Access to the disk volume is now possible only to someone in posession of the
  847. smart card containing the card key.  Since multiple disk keys can be encrypted
  848. with the same card key, one card can control access to a number of disk
  849. volumes.  Since the card key and disk key are completely unrelated, acquiring
  850. the smart card containing the encrypted card key without the user key needed to
  851. decrypt it does not provide an attacker with access to the disk volume.
  852.  
  853.  
  854. Deletion of SFS Volumes
  855.  
  856. Truly deleting data from magnetic media is very difficult.  The problem lies in
  857. the fact that when data is written to the medium, the write head sets the
  858. polarity of most, but not all, of the magnetic domains.  This is partially due
  859. to the inability of the writing device to write in exactly the same location
  860. each time, and partially due to the variations in media sensitivity and field
  861. strength over time and among devices.
  862.  
  863. In general terms, when a one is written to disk, the media records a one, and
  864. when a zero is written, the media records a zero.  However the actual effect is
  865. closer to obtaining something like 0.95 when a zero is overwritten with a one,
  866. and 1.05 when a one is overwritten with a one.  Normal disk circuitry is set up
  867. so that both these values are read as ones, but using specialized circuitry it
  868. is possible to work out what previous `layers' contained (in fact on some
  869. systems it may be possible to recover previous data with a simple software
  870. modification to the hardware control code.  Some drives are capable of
  871. performing "offset reads" to the side of the normal track centres (for example
  872. using SCSI diagnostic commands), so that if the original data was written to
  873. one side, the overwritten data can be recovered by reading from the other side
  874. and applying error-recovery techniques).
  875.  
  876. This problem is further complicated by the fact that the heads might not pass
  877. exactly over the same track position when data is rewritten, leaving a trace of
  878. the old data still intact.  Current-generation drives reduce this problem
  879. somewhat as track and linear densities have now become so high that the
  880. traditional optical methods of extracting information from the disk platters
  881. has become much more difficult, and in some cases impossible, as the linear bit
  882. cell is below the optical diffraction limit for visible light.  While some data
  883. patterns can still be discerned, recognizing others would be limited to some
  884. subset of patterns.  However the recovery of at least one or two layers of
  885. overwritten data isn't too hard to perform by replacing the drive electronics
  886. (but not the read/write head), reading off the "obvious" signal, computing what
  887. it would look like if written to blank media, subtracting that from what was
  888. actually read, and recovering the overwritten data from the difference, a
  889. technique which has occasionally been used by hard drive manufacturers to
  890. recover accidentally overwritten or lost data.
  891.  
  892. Despite this small respite, when all the above factors are combined it turns
  893. out that each track on a piece of media contains an image of everything ever
  894. written to it, but that the contribution from each `layer' gets progressively
  895. smaller the further back it was made.  Using even more advanced techniques than
  896. those mentioned above, like low energy electron scattering, ferrofluid with
  897. optical tracers, or related methods, followed by the same signal-processing
  898. technology which is used to clean up satellite images, low-level recorded
  899. speech, and the like, it is possible to recover layers of previous data with a
  900. remarkable degree of accuracy, to a level limited only by the sensitivity of
  901. the equipment and the amount of expertise of the organisation attempting the
  902. recovery.  Intelligence organisations have a *lot* of expertise in this field.
  903.  
  904. The general concept behind the overwriting scheme used by SFS is to flip each
  905. magnetic domain on the disk back and forth as much as possible (this is the
  906. basic idea behind degaussing) without writing the same pattern twice in a row.
  907. If the data was encoded directly, we could simply choose the desired overwrite
  908. pattern of ones and zeroes and write it repeatedly.  However, disks always use
  909. an NRZI encoding scheme in which a 1 bit signifies an inversion, making the
  910. desired pattern a series of one bits.  This leads to a further complication as
  911. all disks use some form of run-length limited (RLL) encoding, so that the
  912. adjacent ones won't be written.  This encoding is used to ensure that
  913. transitions aren't placed too closely together, or too far apart, which would
  914. mean the drive would lose track of where it was in the data.
  915.  
  916. The parameter to be aware of here is the separation of 1 bits.  Floppies (which
  917. are a more primitive form of the technology used in hard disks) like to keep
  918. the 1 bits 4us apart.  However they can't be kept too far apart or the read
  919. clock loses synchronisation.  This "too far" figure depends a lot on the
  920. technology in the drive, it doesn't depend on the magnetic media much (unlike
  921. the "too close" figure, which depends a lot on the media involved).  The first
  922. single-density encoding wrote one user data bit, then one "1" clock bit, taking
  923. a total of 8us.  This was called FM, since a 1 bit was encoded as two
  924. transitions (1 wavelength) per 8 us, while a 0 bit was encoded as one
  925. transition (1/2 wavelength).
  926.  
  927. Then it was discovered that it was possible to have two 0 bits between adjacent
  928. 1s.  The resulting encoding of 4 bits into 5 was called group code recording
  929. (GCR) which was (0,2) RLL.  This allowed 4 user data bits to be written in
  930. 5 * 4us = 20 us, for an effective time per user bit of 5 us, which was a big
  931. improvement over 8 us.
  932.  
  933. But GCR encoding was somewhat complex.  A different approach was taken in
  934. modified FM (MFM), which suppressed the 1 clock bit except between adjacent
  935. 0's.  Thus, 0000 turned into 0(1)0(1)0(1)0 (where the ()s are the inserted
  936. clock bits), 1111 turned into 1(0)1(0)1(0)1, and 1010 turned into
  937. 1(0)0(0)1(0)0.  The maximum time between 1 bits was now three 0 bits.  However,
  938. there was at least one 0 bit, so it became possible to clock the bits at
  939. 2us/bit and not have more than one 1 bit every 4us.  This achieved one user bit
  940. per 4 us, a result which was better than GCR and obtainable with simpler
  941. circuitry.  As can be seen, the effective data rate depends on the bit rate
  942. (which has been 4 us, 4 us and 2 us in these examples) and the encoding rate, a
  943. measure of the encoding efficiency.  The encoding rates have been 1/2, 4/5 and
  944. 1/2.
  945.  
  946. There is also a (2,7) RLL code with rate 1/2, meaning that 1 user bit maps to 2
  947. encoded bits (although the mapping involves multi-bit groups and is somewhat
  948. complex), but there are always at least two 0 bits between 1 bits, so 1 bits
  949. happen at most every 3 bit times.  This allows the clock to be reduced to
  950. 1.3333 us (this 2/1.33333 = 6/4 = 3/2 is the source of the added capacity gain
  951. of RLL hard drive controllers over equivalent MFM controllers).  The time per
  952. user bit is now 2.6666 = 2 2/3 us.
  953.  
  954. However, the faster clock is finicky.  It is also possible to use a (1,7) RLL
  955. encoding.  Since this is (1,x), the clock rate is 2 us/bit, but the encoding
  956. efficiency improves from 1/2 to 2/3.  This allows 2 effective user bits per 6
  957. us, or 3 us per user bit.  For hard drives, it is easier to increase the clock
  958. rate by an extra 9/8 than to fiddle with a clock 50% faster, so this is very
  959. popular with more recent disk drives.
  960.  
  961. To erase magnetic media, we need to overwrite it many times with alternating
  962. patterns in order to expose it to a magnetic field oscillating fast enough that
  963. it does the desired flipping of the magnetic domains in a reasonable amount of
  964. time.  Unfortunately, there is a complication in that we need to saturate the
  965. disk surface to the greatest depth possible, and very high frequency signals
  966. only "scratch the surface" of the magnetic medium.  Disk drive manufacturers,
  967. in trying to achieve ever-higher densities, use the highest possible
  968. frequencies, whereas we really require the lowest frequency a disk drive can
  969. produce.  Even this is still rather high.  In fact, a full erasure of the disk
  970. is generally impossible to perform, as can be seen by considering the manner in
  971. which servo information is encoded.
  972.  
  973. All disk drives need what is called "servo" information indicating where the
  974. head is relative to the centre of the track it is trying to read.  Older drives
  975. used one of two techniques, the first of which was the "separate servo"
  976. technique in which one surface of the stack of platters was reserved for servo
  977. information used to control the stack of arms for the other platters.  This
  978. gave a high update rate for the servo information, but didn't allow for any
  979. adjustment for differential expansion of the platters or arms, or tilting of
  980. the stack of arms.  This multiplexing in space of the servo information was
  981. limited by the accuracy to which two heads could be aligned in the same stack.
  982.  
  983. The other technique was the "embedded servo" technique in which the servo
  984. information was placed on the same platter as the data, between the data blocks
  985. in the header area.  This meant that the same head was used to read the servo
  986. information and disk data, but led to gaps while reading and writing the data.
  987. This technique multiplexes the servo information in time.
  988.  
  989. A newer technique is called "servo-under" (also known as "dedicated servo"),
  990. and writes the servo information "under" the data, at a lower frequency.  The
  991. normal data write frequencies are high enough, and the write signal weak
  992. enough, that it never penetrates to the bottom of the the magnetic media and so
  993. the servo is unaffected by writing to the disk (in fact, even if the head was
  994. writing DC it probably wouldn't be able to generate a strong enough signal to
  995. penetrate to the servo data).  A couple of filters separate the servo
  996. information from the data, so that the servo information can be accessed from
  997. the same head and at the same time as the data is read.  This technique is very
  998. convenient, but shows that the media can never be completely saturated, since
  999. doing this would erase the servo information, making the disk useless.
  1000.  
  1001. However, what we can do is to use the lowest frequency possible for overwrites,
  1002. to penetrate as deeply as possible into the recording medium.  To do this, we
  1003. must determine what decoded data to write to produce a low-frequency encoded
  1004. signal.
  1005.  
  1006. The three most common RLL codes are (1,3) RLL (usually known as MFM), (2,7) RLL
  1007. (the original "RLL" format), and (1,7) RLL (which is popular in newer drives).
  1008. These three cover the vast majority of magnetic disk drives.  However, each of
  1009. these has several possible variants.  With MFM, only one is used with any
  1010. frequency, but the newest (1,7) RLL code has at least half a dozen variants in
  1011. use.  (1,3) RLL and (2,7) RLL have coding rates of 1/2, meaning that one
  1012. "useful" decoded bit requires two encoded bits.  (1,7) RLL has a rate of 2/3,
  1013. so two decoded bits correspond to three encoded bits.
  1014.  
  1015. For MFM, there are at most 4 bit times between transitions, so the lowest
  1016. frequency possible is "4T", attained by the repeating decoded data patterns
  1017. 1010 and 0101.  These have a 1 bit every other "data" bit, and the intervening
  1018. "clock" bits are all 0.  To complete the set, we would like patterns with every
  1019. other clock bit set to 1 and all others set to 0, but these are not possible in
  1020. the MFM encoding (such "violations" are used to generate special marks on the
  1021. disk to identify sector boundaries).
  1022.  
  1023. The best we can do is 3 bit times between transitions, a 3T frequency, which is
  1024. generated by repeating the decoded patterns 100100, 010010 and 001001.  We
  1025. should use several of rounds of these patterns, as MFM drives are the oldest,
  1026. lowest-density drives around (this is especially true for the very-low-density
  1027. floppy drives).  As such, they are the easiest to recover data from with modern
  1028. equipment and we need to take the most care with them.
  1029.  
  1030. For (1,7) RLL, although there can be as many as 8 bit times between
  1031. transitions, the lowest sustained frequency we can have is 6T, 6 bit times
  1032. between transitions.  This is a desirable property from the point of view of
  1033. the clock-recovery circuitry, and all (1,7) RLL codes seem to have this
  1034. property.  We now need to find a way to write the desired pattern without
  1035. knowing the particular (1,7) RLL code used.  We can do this by looking at the
  1036. way the drive's error-correction system works.  The error-correction is applied
  1037. to the decoded data, even though errors generally occur in the encoded data.
  1038. In order to make this work well, the data encoding should have limited error
  1039. amplification, so that an erroneous encoded bit should affect only a small,
  1040. finite number of decoded bits.
  1041.  
  1042. Decoded bits therefore depend only on nearby encoded bits, so that a repeating
  1043. pattern of encoded bits will correspond to a repeating pattern of decoded bits.
  1044. The repeating pattern of encoded bits is 6 bits long.  Since the rate of the
  1045. code is 2/3, this corresponds to a repeating pattern of 4 decoded bits.  There
  1046. are only 16 possibilities for this pattern, making it feasible to write all of
  1047. them during the erase process.  So to achieve good overwriting of (1,7) RLL
  1048. disks, we write the patterns 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111,
  1049. 1000, 1001, 1010, 1011, 1100, 1101, 1110, and 1111.  These patterns also
  1050. conveniently cover two of the ones needed for MFM overwrites, although we
  1051. should add a few more iterations of the MFM-specific patterns for the reasons
  1052. given above.
  1053.  
  1054. For (2,7) RLL, we again have 6T as the lowest systainable frequency, which
  1055. maps, at an encoding rate of 1/2, to some repeating pattern of 3 decoded bits,
  1056. so we require all 8 possible 3-bit repeating patterns.  The all-zeros and
  1057. all-ones patterns overlap with the (1,7) RLL patterns, leaving six others:
  1058.  
  1059.   001001001001001001001001
  1060.      2   4   9   2   4   9
  1061.  
  1062. in binary or 0x24 0x92 0x49, 0x92 0x49 0x24 and 0x49 0x24 0x92 in hex, and
  1063.  
  1064.   011011011011011011011011
  1065.      6   D   B   6   D   B
  1066.  
  1067. in binary or 0x6D 0xB6 0xDB, 0xB6 0xDB 0x6D and 0xDB 0x6D 0xB6 in hex.  The
  1068. first three are the same as the MFM patterns, so we need only three extra
  1069. patterns to cover (2,7) RLL drives.
  1070.  
  1071. Although (1,7) is more popular in recent drives, some hard drives do still use
  1072. (2,7) RLL.  These three patterns also cover any problems with endianness
  1073. issues, which weren't a concern in the previous two cases, but would be in this
  1074. case (actually, thanks to the strong influence of IBM mainframe drives,
  1075. everything seems to be uniformly big-endian within bytes, with the most
  1076. significant bit being written to the disk first).
  1077.  
  1078. For the latest crop of high-density drives which use methods like Partial-
  1079. Response Maximum-Likelihood (PRML) methods which may be roughly equated to the
  1080. trellis encoding done by V.32 modems in that it is effective but
  1081. computationally expensive, all we can do is write a variety of random patterns,
  1082. because the processing inside the drive is too complex to second-guess.
  1083. Fortunately, these drives push the limits of the magnetic media much more than
  1084. the old MFM drives ever did by encoding data with much smaller magnetic
  1085. domains, closer to the physical capacity of the magnetic media.  If these
  1086. drives require sophisticated signal processing just to read the most recently
  1087. written data, reading overwritten layers is also correspondingly more
  1088. difficult.  A good scrubbing with random data will do about as well as can be
  1089. expected.
  1090.  
  1091. We now have a set of 22 overwrite patterns which will erase everything,
  1092. regardless of the raw encoding.  The basic disk eraser can be improved slightly
  1093. by adding random passes before, after, and during the erase process, and by
  1094. performing the deterministic passes in random order to make it more difficult
  1095. to guess which of the known data passes were made at which point.
  1096.  
  1097. To deal with all this in one overwrite pattern, SFS uses the following sequence
  1098. of 35 consecutive writes to erase data:
  1099.  
  1100.    1.  Random
  1101.    2.  Random
  1102.    3.  Random
  1103.    4.  Random
  1104.    5.  01010101 01010101 01010101  0x55           (1,7) RLL             MFM
  1105.    6.  10101010 10101010 10101010  0xAA           (1,7) RLL             MFM
  1106.    7.  10010010 01001001 00100100  0x92 0x49 0x24            (2,7) RLL  MFM
  1107.    8.  01001001 00100100 10010010  0x49 0x24 0x92            (2,7) RLL  MFM
  1108.    9.  00100100 10010010 01001001  0x24 0x92 0x49            (2,7) RLL  MFM
  1109.   10.  00000000 00000000 00000000  0x00           (1,7) RLL  (2,7) RLL
  1110.   11.  00010001 00010001 00010001  0x11           (1,7) RLL
  1111.   12.  00100010 00100010 00100010  0x22           (1,7) RLL
  1112.   13.  00110011 00110011 00110011  0x33           (1,7) RLL
  1113.   14.  01000100 01000100 01000100  0x44           (1,7) RLL
  1114.   15.  01010101 01010101 01010101  0x55           (1,7) RLL             MFM
  1115.   16.  01100110 01100110 01100110  0x66           (1,7) RLL
  1116.   17.  01110111 01110111 01110111  0x77           (1,7) RLL
  1117.   18.  10001000 10001000 10001000  0x88           (1,7) RLL
  1118.   19.  10011001 10011001 10011001  0x99           (1,7) RLL
  1119.   20.  10101010 10101010 10101010  0xAA           (1,7) RLL             MFM
  1120.   21.  10111011 10111011 10111011  0xBB           (1,7) RLL
  1121.   22.  11001100 11001100 11001100  0xCC           (1,7) RLL
  1122.   23.  11011101 11011101 11011101  0xDD           (1,7) RLL
  1123.   24.  11101110 11101110 11101110  0xEE           (1,7) RLL
  1124.   25.  11111111 11111111 11111111  0xFF           (1,7) RLL  (2,7) RLL
  1125.   26.  10010010 01001001 00100100  0x92 0x49 0x24            (2,7) RLL  MFM
  1126.   27.  01001001 00100100 10010010  0x49 0x24 0x92            (2,7) RLL  MFM
  1127.   28.  00100100 10010010 01001001  0x24 0x92 0x49            (2,7) RLL  MFM
  1128.   29.  01101101 10110110 11011011  0x6D 0xB6 0xDB            (2,7) RLL
  1129.   30.  10110110 11011011 01101101  0xB6 0xDB 0x6D            (2,7) RLL
  1130.   31.  11011011 01101101 10110110  0xDB 0x6D 0xB6            (2,7) RLL
  1131.   32.  Random
  1132.   33.  Random
  1133.   34.  Random
  1134.   35.  Random
  1135.  
  1136. The MFM-specific patterns are repeated twice because MFM drives are generally
  1137. the lowest density, and are thus particularly easy to examine.  The
  1138. deterministic patterns between the random writes are permuted before the write
  1139. is performed, to make it more difficult for an opponent to use knowledge of the
  1140. erasure data written to attempt to recover overwritten data (in fact we need to
  1141. use a cryptographically strong random number generator to perform the
  1142. permutations to avoid an opponent who can read the last overwrite pass being
  1143. able to predict the previous passes and "echo cancel" passes by subtracting the
  1144. known overwrite data).
  1145.  
  1146. If the device being written to supports cacheing or buffering of data, SFS will
  1147. additionally attempt to disable the buffering to ensure physical disk writes
  1148. are performed (for example by setting the Force Unit Access bit during SCSI-2
  1149. Group 1 write commands).
  1150.  
  1151. There is a commonly-held belief that there is a US government standard for
  1152. declassifying magnetic media which simply involves overwriting data on it three
  1153. times.  There are in fact a number of standards[1] which contain simple phrases
  1154. such as "Magnetic disks, drums, and other similar rigid storage devices shall
  1155. be sanitized by overwriting all storage locations with any character, then the
  1156. complement of the character (e.g., binary ones and binary zeros) alternately a
  1157. minimum of three times".  However this simple description is usually
  1158. reinterpreted by the appropriate government agencies to a level which often
  1159. makes physical destruction of the media and its replacement with new media
  1160. preferable to attempting any declassification by overwriting the data (the
  1161. (classified) standards for truly declassifying magnetic media probably involve
  1162. concentrated acid, furnaces, belt sanders, or any combination of the above[2]).
  1163. One unclassified standard which contains information on data erasure is ANSI
  1164. X9.17-1985 "Financial Key Management (Wholesale)", Appendix E, "Erasing
  1165. (Zeroizing) Recording Media Used for Storage of Keying Material".  Section E.5,
  1166. "Disk Pack" contains three possible alternatives: "(a) Apply an emery wheel or
  1167. sander to the recording surface of an inoperative disk.  Ensure that the entire
  1168. surface is completely removed prior to disposal.  (b) The resin binder and
  1169. ferric oxide surfece can be completely removed/stripped (chemically destroyed)
  1170. from the disk with concentrated hydrochloric acid (55-58%).  (c)  Melting".
  1171. This applies only to non-classified data, the sanitizing of media containing
  1172. classified information is generally handled in a far more paranoid manner.
  1173.  
  1174. The use of such extreme measures is necessary not only because data recovery
  1175. from the actual tracks itself may (with some effort) be possible, but because
  1176. of factors like intelligent drives which keep so-called "alternative cylinders"
  1177. on a disk free to allow dynamic re-allocation of data to one of these tracks in
  1178. case a disk block develops errors.  The original block is no longer accessible
  1179. through any sort of normal access mechanism, and the data on it can't be
  1180. destroyed without going through some unusual contortions which tend to be
  1181. highly hardware-dependant.  Other complications include the use of journaling
  1182. filesystems which keep track of previous generations of data, and disk
  1183. compression software or hardware which will compress a simple repeated
  1184. overwrite pattern to nothing and leave the original data intact on the disk[3].
  1185. Therefore if "overwriting all storage locations" is interpreted to mean
  1186. "exposing the entire reading surface to a magnetic field having a strength at
  1187. the recording surface greater than the field intensity at which it was
  1188. recorded", the method does have merit.  Unfortunately it is virtually
  1189. impossible to get at all storage locations, and simple-minded methods such as
  1190. trying to write patterns to the storage allocated to a file in order to erase
  1191. it don't even come close to this target.  The overwrite method used by SFS does
  1192. come reasonably close by attempting to create a fluctuating magnetic field over
  1193. all physically accessible sectors which make up a disk volume, creating the
  1194. same effect as a degaussing tool used to erase magnetic fields.
  1195.  
  1196. One possibility for lessening the impact of encrypted data being retained on a
  1197. disk long after it should have vanished is to frequently change an encryption
  1198. parameter so that the encrypted data also changes when the encryption parameter
  1199. is changed.  For the case of SFS disk keys, all this would require is that at
  1200. certain intervals (for example each time the volume is mounted) the disk key is
  1201. re-encrypted with a different random initialization vector and written back to
  1202. the disk so that the key never has time to get "burned in" to the media.
  1203. However this still leaves the problem of the last-written key being present,
  1204. and is probably not worth the effort involved in constantly updating the key.
  1205.  
  1206. Another consideration which needs to be taken into account when trying to erase
  1207. data through software is that drives conforming to some of the higher-level
  1208. protocols such as the various SCSI standards are relatively free to interpret
  1209. commands sent to them in whichever way they choose (as long as they still
  1210. conform to the SCSI specification).  Thus some drives, if sent a FORMAT UNIT
  1211. command may return immediately without performing any action, may simply
  1212. perform a read test on the entire disk (the most common option), or may
  1213. actually write data to the disk[4][5].  This is rather common among newer
  1214. drives which can't directly be low-level formatted, unlike older ST-412 and
  1215. ST-506 MFM or RLL drives.  For example trying to format an IDE drive generally
  1216. has little effect - a low-level format generally isn't possible, and the
  1217. standard DOS `format' command simply writes a boot record, FAT, and root
  1218. directory, performs a quick scan for bad sectors, and exits.
  1219.  
  1220. Therefore if the data is very sensitive and is stored on floppy disk, it can
  1221. best be destroyed by removing the media from the disk liner and burning it.
  1222. Disks are relatively cheap, and can easily be replaced.  Permanently destroying
  1223. data on fixed disks is less simple, but the multiple-overwrite option used by
  1224. SFS at least makes it quite challenging (and expensive) to recover any
  1225. information.
  1226.  
  1227. Footnote [1]: Among others there is the Department of Defense standard DoD
  1228.               5200.28-M, Army standard AR 380-19, Navy standards OPNAVINST
  1229.               5510.1H and NAVSO P-5239-26, Air Force standard AFSSI-5020, and
  1230.               Department of Energy standard DOE 5637.1.
  1231.  
  1232. Footnote [2]: The UK Ministry of Defence grinds down disk platters and then
  1233.               supposedly stores the (still-classified) dust for a decade or
  1234.               more.  Rumours that they remove programmers brains for storage in
  1235.               order to erase the classified information they contain are
  1236.               probably unfounded.
  1237.  
  1238. Footnote [3]: From a posting to the usenet alt.security newsgroup on 1 August
  1239.               1994, message-ID <31c75s$pa8@search01.news.aol.com>: "I got fired
  1240.               from my job and was told to clean my desk, so I immediately went
  1241.               to my office and ran Norton WipeDisk on my hard drive, which
  1242.               contained much of the work I had done and also my contact list,
  1243.               letters, games, and so on.  Unfortunately, I had DoubleSpaced it
  1244.               and the files were easily recovered".
  1245.  
  1246. Footnote [4]: Again it may be possible to bypass this using highly hardware-
  1247.               specific methods.  For example Quantum SCSI drives manufactured a
  1248.               few years ago could be forced to write data to disk during a
  1249.               format by changing the sector filler byte before the format
  1250.               command was issued.
  1251.  
  1252. Footnote [5]: The SCSI-2 standard includes an initialization pattern (IP)
  1253.               option for the FORMAT UNIT command (Section 8.2.1.2), however it
  1254.               is not clear how well this is supported by existing drives.
  1255.  
  1256.  
  1257. Safeguarding Cryptographic Keys
  1258.  
  1259. A threshold scheme divides a message (in this case the key to be protected)
  1260. into `n' pieces, or shares, so that any `m' of these shares can be used to
  1261. reconstruct the key, but `m-1' or less cannot reconstruct it.  This is called
  1262. an (m,n) threshold scheme.
  1263.  
  1264. A simple all-or-nothing scheme would break a key into `n' parts such that the
  1265. key could be recovered by taking the exclusive-or of these parts.  However this
  1266. method allows no margin of error, since even a single missing share will
  1267. destroy the ability to recreate the key.  This method allows for a limited form
  1268. of key safeguarding, but is not a true threshold scheme.
  1269.  
  1270. SFS uses a true threshold scheme, namely the one presented in "How to Share a
  1271. Secret" by Adi Shamir, Communications of the ACM, Vol.22, No.11 (November
  1272. 1979), p.612.  This involves chosing a prime `p' which is larger than the
  1273. number of shares required, and an arbitrary polynomial of degree `m-1', where
  1274. `m' is the number of shares necessary to reconstruct the secret.  To distribute
  1275. the secret data, we generate a polynomial:
  1276.  
  1277.     ax^(m-1) + bx^(m-2) ... + cx + M (mod p)
  1278.  
  1279. where `a' ... `c' are random secret coefficients which are discarded once the
  1280. data has been distributed, `p' is a prime number larger than any of the
  1281. coefficients, and `M' is the secret to be distributed.  For example if we
  1282. wanted to create a (3,n) threshold scheme in which three shares out of the
  1283. total number would be necessary to reconstruct the secret data, we would
  1284. generate the quadratic polynomial:
  1285.  
  1286.     ax^2 + bx + M (mod p)
  1287.  
  1288. The shares themselves are obtained by evaluating the polynomial at `n'
  1289. different points, where `n' is the total number of shares distributed.  In this
  1290. case for our polynomial f() we evaluate it at x = 1, x = 2, ... x = n, and
  1291. distribute the resulting f( 1 ), f( 2 ), ... f( n ) values as the share data.
  1292. Since the polynomial has `m' unknown coefficients a, b, ... c and M, any `m'
  1293. shares can be used to create `m' equations, after which linear algebra can be
  1294. used to solve for M.  `m-1' shares can't recreate the secret.  More than `m'
  1295. shares are redundant.
  1296.  
  1297. For example, suppose we wish to create a (3,5) threshold scheme in which any 3
  1298. of a total of 5 shares are sufficient to reconstruct the secret M.  Assuming
  1299. M = 5 and taking two random coefficients a = 4 and b = 6 and a prime p = 13, we
  1300. have:
  1301.  
  1302.     f(x) = 4x^2 + 6x + 5 (mod 13)
  1303.  
  1304. Evaluating this at x = 1...5 gives:
  1305.  
  1306.     f(1) = 4 + 6 + 5 (mod 13)
  1307.          = 2
  1308.     f(2) = 16 + 12 + 5 (mod 13)
  1309.          = 7
  1310.     f(3) = 36 + 18 + 5 (mod 13)
  1311.          = 7
  1312.     f(4) = 64 + 24 + 5 (mod 13)
  1313.          = 2
  1314.     f(5) = 100 + 30 + 5 (mod 13)
  1315.          = 5
  1316.  
  1317. To reconstruct `M' from three of these shares (for example share 1, 3, and 5),
  1318. we need to solve the set of linear equations:
  1319.  
  1320.     2 = a.1^2 + b.1 + M (mod 13)
  1321.     7 = a.3^2 + b.3 + M (mod 13)
  1322.     5 = a.5^2 + b.5 + M (mod 13).
  1323.  
  1324. We can do this using Lagrange interpolation to recover the values a = 4, b = 6,
  1325. and M = 13, giving us the original secret.
  1326.  
  1327. A single share therefore consists of an X coordinate 1, 2, ... n, and however
  1328. many Y coordinates f( 1 ), f( 2 ), ... f( n ) are needed.  The total set of
  1329. shares is a set of X coordinates X[] and a corresponding number of Y
  1330. coordinates Y[].
  1331.  
  1332. To reconstruct the secret, we first calculate the coefficients C[]:
  1333.  
  1334.     for( i = 0; i < m; i++ )
  1335.         C[ i ] = 1;
  1336.         for( j = 0; j < m; j++ )
  1337.             if( i != j )
  1338.                 C[ i ] *= X[ j ] / ( X[ i ] - X[ j ] );
  1339.  
  1340. Once we have the coefficients, we can reconstruct the secret from the rest of
  1341. the share, namely the Y coordinates:
  1342.  
  1343.     secret = 0;
  1344.     for( i = 0; i < m; i++ )
  1345.         secret += C[ i ] * Y[ i ];
  1346.  
  1347. To make the secret-sharing task easier, we use a finite field for all our work.
  1348. An exact explanation of the theory involved is beyond the scope of this
  1349. document, anyone interested in more background details should refer to the
  1350. references in the "Recommended Reading" section below.  It suffices to note
  1351. that the secret sharing scheme used by SFS works in GF( 2^n ), in which
  1352. addition, subtraction, multiplication, and division are all well defined.
  1353. There is an additive identity 0, a multiplicative identity 1, every nonzero
  1354. number has a unique inverse, and the commutative, associative, and distributive
  1355. laws all hold.  Galois fields are very convenient to work with since they keep
  1356. the numbers involved to a finite size, and there are no rounding errors in
  1357. division.
  1358.  
  1359. All arithmetic is done modulo an irreducible polynomial of degree `n'.  The
  1360. characteristics of the Galois fields used by SFS are as follows:
  1361.  
  1362.      n      Max.no of shares    Generator polynomial
  1363.  
  1364.      4            15            x^4 + x + 1
  1365.      5            31            x^5 + x^2 + 1
  1366.      6            63            x^6 + x + 1
  1367.      7           127            x^7 + x + 1
  1368.      8           255            x^8 + x^4 + x^3 + x^2 + 1
  1369.      9           511            x^9 + x^4 + 1
  1370.     10          1023            x^10 + x^3 + 1
  1371.     11          2047            x^11 + x^2 + 1
  1372.     12          4095            x^12 + x^6 + x^4 + x + 1
  1373.     13          8191            x^13 + x^4 + x^3 + x + 1
  1374.     14         16383            x^14 + x^5 + x^3 + x + 1
  1375.     15         32767            x^15 + x + 1
  1376.     16         65535            x^16 + x^5 + x^3 + x^2 + 1
  1377.  
  1378. Although SFS could use any of GF( 2^4 ) ... GF( 2^16 ), the current
  1379. implementation is restricted to GF( 2^8 ) to allow data to be processed in
  1380. byte-sized quantities.
  1381.  
  1382. The use of a threshold scheme can be extended to allow shareholders to be
  1383. replaced or added at a later point using the techniques given in David Chaum's
  1384. paper "How to Keep a Secret Alive", presented during Crypto'84 and appearing in
  1385. volume 196 of the Lecture Notes in Computer Science published by
  1386. Springer-Verlag (ISBN 3-540-15658-5 and 0-387-15658-5).  The replacement of
  1387. a shareholder requires that a shareholder break his share into subshares and
  1388. distribute the subshares to the other shareholders, allowing them to recreate
  1389. his share if it is lost or destroyed.  The creation of a new shareholder
  1390. requires the generation of additional shares which are again broken into
  1391. subshares and distributed to shareholders.  In either case a quorum of
  1392. shareholders can use their subshares to vote on whether a shareholder should be
  1393. replaced, or a new shareholder created.  SFS does not currently support this
  1394. extended key safeguarding due to the complexity involved in its use.
  1395.